<template>
	<view>
		<!-- 页面标题 start -->
		<cu-custom bgColor="bg-gradual-blue" :isBack="true">
			<block slot="content">中介机构</block>
		</cu-custom>
		<!-- 页面标题 end -->
		<!-- 搜索框 start -->
		<u-search @search="initData" v-model="title"></u-search>
		<!-- 搜索框 end -->
		<zjjg-list @scrolltolower="scrolltolower" v-model="institutionList"></zjjg-list>
	</view>
</template>

<script>
	import companyMixin from "@/common/request/company.js"
	export default {
		mixins: [companyMixin],
		created() {
			this.initData()
		},
		data() {
			return {
				title: undefined,
				institutionList: [], // 机构列表
				page: {
					pageSize: 20,
					pageNo: 1
				}
			}
		},
		methods: {
			/**
			 * 获取数据
			 */
			initData() {
				const pd = {
					pageSize: this.page.pageSize,
					pageNo: this.page.pageNo,
					company: this.title
				}
				this.getCompany(pd, data => {
					this.institutionList = data
				})
			},
			/**
			 * 翻页
			 */
			scrolltolower() {
				this.page.pageNo += 1
				const pd = {
					pageSize: this.page.pageSize,
					pageNo: this.page.pageNo,
					title: this.title
				}
				this.getCompany(pd, data => {
					this.institutionList = this.institutionList.concat(data)
				})
			}
		}
	}
</script>

<style>

</style>
